package model;

import java.io.Serializable;

import javax.persistence.*;

import java.util.Date;


/**
 * The persistent class for the nota database table.
 * 
 */
@Entity
@Table(name="nota")
@NamedQuery(name="Nota.findAll", query="SELECT n FROM Nota n")
public class Nota implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@Column(unique=true, nullable=false)
	private int id;

	@Temporal(TemporalType.DATE)
	@Column(nullable=false)
	private Date data;

	@Column(nullable=false)
	private int nota;

	//bi-directional many-to-one association to Materie
	@ManyToOne
	@JoinColumn(name="id_materie", nullable=false)
	private Materie materie;

	//bi-directional many-to-one association to Student
	@ManyToOne
	@JoinColumn(name="id_student", nullable=false)
	private Student student;

	public Nota() {
	}

	public int getId() {
		return this.id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public Date getData() {
		return this.data;
	}

	public void setData(Date data) {
		this.data = data;
	}

	public int getNota() {
		return this.nota;
	}

	public void setNota(int nota) {
		this.nota = nota;
	}

	public Materie getMaterie() {
		return this.materie;
	}

	public void setMaterie(Materie materie) {
		this.materie = materie;
	}

	public Student getStudent() {
		return this.student;
	}

	public void setStudent(Student student) {
		this.student = student;
	}
	
	public String toString()
	{
		return "Nota id:"+id+", Student:"+student.getNume()+", Materie:"+materie.getDenumire()+", Nota:"+nota+", Data:"+data;
	}

}